package com.owen.server.impl;

import com.owen.dao.FruitsDao;
import com.owen.pojo.Fruits;
import com.owen.server.FruitsServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FruitsServerImpl implements FruitsServer {

    @Autowired
    private FruitsDao fruitsDao;

    @Override
    public List<Fruits> findAll() {
        return fruitsDao.findAll();
    }

    @Override
    public List<Fruits> findByFruits(Fruits fruits) {
        return fruitsDao.findByFruits(fruits);
    }

    @Override
    public Fruits findById(Long id) {
        return fruitsDao.findById(id);
    }

    @Override
    public Integer deleteById(Long id) {
        return fruitsDao.deleteById(id);
    }

    @Override
    public Integer updateByFruits(Fruits fruits) {
        return fruitsDao.updateByFruits(fruits);
    }

    @Override
    public Integer addFruits(Fruits fruits) {
        return fruitsDao.addFruits(fruits);
    }

    @Override
    public Integer deleteBatch(Long[] id) {
        return fruitsDao.deleteBatch(id);
    }

    @Override
    public List<Fruits> findLeftFruitsCake(Long id) {
        return fruitsDao.findLeftFruitsCake(id);
    }

}